package com.lt.utils;

public class GetWeekday {
    private int y, m, d, w;
    private final String[] Weekday = {"星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"};
    private final Integer[] integers;

    public GetWeekday(String str) {
        integers = new GetTimeString(str).getNowPriTime();
    }

    public String getWeekday() {
        y = integers[0];
        m = integers[1];
        d = integers[2];
        if (m == 1) {
            y = y - 1;
            m = 13;
        }
        if (m == 2) {
            y = y - 1;
            m = 14;
        }
        w = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
        return Weekday[w];
    }
}
